<?php
// +----------------------------------------------------------------------
// | huicmf [ huicmf快速开发框架 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2022~2024 https://xiaohuihui.cc All rights reserved.
// +----------------------------------------------------------------------
// | Author: 小灰灰 <762229008@qq.com>
// +----------------------------------------------------------------------
// | Info:
// +----------------------------------------------------------------------
namespace app\api\controller;

use libs\GetKeywords;
use think\facade\Request;

class Api
{

    /**
     * 分词-获取关键词
     * @return string
     * @throws \Exception
     */
    public function get_keywords()
    {
        $title   = Request::param('title');
        $content = Request::param('content');
        try {
            $res = GetKeywords::getKeywores($title, $content, 10);
        } catch (\Exception $e) {
            throw new \Exception($e->getMessage());
        }

        return json($res);
    }
}
